Previous Book Contents Book Index Next

Inside Macintosh: Open Transport /
Chapter 8 - TCP/IP Services / TCP/IP Services Reference
Constants and Data Types


DNS Address Structure

You can use the DNS (domain name system) address structure with the OTConnect function when you are creating a TCP endpoint, with the OTSndUData function when you are creating a UDP endpoint, or with the OTResolveAddress function with either TCP or UDP endpoints. If you do so, the domain name resolver (DNR) will resolve the address for you automatically. You can use the OTInitDNSAddress function (page 8-53) to fill in a DNS address structure. The DNS address structure is defined by the DNSAddress data type.

struct DNSAddress {
   OTAddressType  fAddressType;/* address type; always AF_DNS */
   InetDomainName fName;      /* domain name */
};
Field Description
fAddressType
The address type. The only possible value for this field is AF_DNS.
fName
The address to be resolved by the DNR.
This address you specify can be just the host name ("otteam"), a partially qualified domain name ("otteam.ssw"), a fully qualified domain name ("otteam.ssw.apple.com."), or an internet address in dotted-decimal format ("17.202.99.99"), and can optionally include the port number ("otteam.ssw.apple.com:25" or "17.202.99.99:25").

Because the port number is not actually part of the domain name, it is possible to have a domain name-port number combination that exceeds 255 bytes. If you wish to specify such a string, you must provide a structure based on the DNS address structure that has sufficient space to contain the full string. In any case, the domain name itself cannot exceed 255 bytes.

You can use the DNS address structure to provide an unresolved TCP address with the OTConnect function or a UDP address with the OTSndUData function. To do so, specify a pointer to the DNS address structure as the udata->addr.buf parameter in your call to the OTSndUData function or as the sndCall->addr.buf parameter in your call to the OTConnect function.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 AUG 1996